package Test2;

public class Retanle extends Shape{
    private double length;
    private double width;

    public Retanle(double length, double width) {
        this.length = length;
        this.width = width;
    }

    @Override
    public double area() {
        return length * width;
    }

    @Override
    public double perimeter() {
        return length + width;
    }

    @Override
    public String toString() {
        return String.valueOf("矩形面积：" + area() + "矩形周长：" +perimeter());
    }

    public double getlength() {
        return length;
    }

    public void setlength(double length) {
        this.length = length;
    }

    public double getWidth() {
        return width;
    }

    public void setWidth(double width) {
        this.width = width;
    }

}
